package cn.varton.wrapper;

import cn.varton.IBelong;

public class Ipv6Belong implements IBelong {
    private IBelong ipBelong;

    public Ipv6Belong(IBelong ipBelong) {
        this.ipBelong = ipBelong;
    }

    @Override
    public void queryBelong(String param) {
        if (param.matches("^([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){3}[0-9A-Fa-f]{1,4})$")){
            System.out.println("查询IPv6："+param+",归属地为：广东佛山");
        }else {
            ipBelong.queryBelong(param);
        }
    }
}
